if __name__ == '__main__':  
    import socket  
    
    sock_clt = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock_clt.connect(("192.168.50.13", 2525))
    print 'connect to server success!'
    while True:
        import time
        #time.sleep(2)
        print 'say something to server:' 
        msg = raw_input()
        sock_clt.send(msg)
        
        if msg == 'exit':
            break;
        
        
        buf = sock_clt.recv(100)
        print 'server say: ' + buf
        
        if buf == 'exit':
            print 'server request exit!'
            break;
    
    print 'now exit!'
    sock_clt.close()